package com.learn.fst.model.version;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.nustaq.serialization.annotations.Version;

import java.io.Serial;
import java.io.Serializable;

/**
 * @author XuYang
 * @since 2025/2/10 15:42
 */
@NoArgsConstructor
@AllArgsConstructor(staticName = "of")
@Data
public class VersionEntity
    implements Serializable
{
    @Serial
    private static final long serialVersionUID = 1L;

    @Version(1)
    private Long id;
    // 当反序列化版本1时,如果字段没有该@Version时,会报null指针异常
    @Version(2)
    private String name;
}
